package top.xchch.aop.helloworld;

public class Main {
	
	public static void main(String[] args) {
		
		ArithmeticCalculator target = new ArithmeticCalculatorImpl();
		
		int result = target.add(1, 1);
		System.out.println("--> " + result);
		
		result = target.sub(3, 1);
		System.out.println("--> " + result);
		
		System.out.println("-----------------------------------------");
		
		ArithmeticCalculator target2 = new ArithmeticCalculatorImpl();
		ArithmeticCalculator proxy = new ArithmeticCalculatorLoggingProxy(target2).getLoggingProxy();
		
		System.out.println(proxy.getClass().getName());
		int result2 = proxy.add(1, 1);
		System.out.println("--> " + result2);
		
		result2 = proxy.sub(3, 1);
		System.out.println("--> " + result2);
		
	}
}
